#!/bin/bash
# Test mass erase
#./uniflash_linux_64/dslite.sh -c uniflash_linux_64/user_files/configs/cc2640r2f.ccxml -f uniflash_linux_64/ccs_base/arm/FlashLoaderCC26x0.out

BIM_PATH=$(dirname "$PWD")/bim_oad_offchip_cc2640r2lp_app/FlashOnly
STATCK_PATH=$(dirname "$PWD")/simple_peripheral_cc2640r2lp_oad_offchip_stack/FlashROM
APP_PATH=$(dirname "$PWD")/simple_peripheral_cc2640r2lp_oad_offchip_app/FlashROM

TPWD=$PWD

cd $BIM_PATH
echo "bim"
BIM_HEX=`ls *.hex`
cd $TPWD

cd $STATCK_PATH
echo "stack"
STATCK_HEX=`ls *.hex`
cd $TPWD

cd $APP_PATH
echo "app"
APP_OUT=`ls *.out`
cd $TPWD

cd uniflash_linux_64
. dslite_boarddownload.sh $BIM_PATH/$BIM_HEX $STATCK_PATH/$STATCK_HEX 
. dslite_boarddownload.sh $APP_PATH/$APP_OUT
